#ifndef JSON_ARRAY_H
#define JSON_ARRAY_H

#include "JsonValue.h"

namespace simframework
{
	namespace json
	{
		class Object;
		class Array
		{
		public:
			explicit Array(std::wostream& js);

			Array(const Array& other);

			~Array();

			Array startArray();

			Object startObject();

			template <typename T>
			void push_back(const T& value)
			{
				writeSeperator();
				Value::add(value, m_jsonStream);
			}		

		protected:

		private:
			void writeSeperator();
			Array& operator=(const Array&);
			std::wostream& m_jsonStream;
			bool m_isFirstElement;
		};
	};
}

#endif //JSON_ARRAY_H